package com.coolwen.entity;

import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import java.util.Date;

public class LoginUser {
    private Integer loginId;

    private String loginName;

    private String loginPassword;

    private Date loginTime;

    private Boolean loginSign;

    public Integer getLoginId() {
        return loginId;
    }

    public void setLoginId(Integer loginId) {
        this.loginId = loginId;
    }

    @NotEmpty(message = "用户名不能为空")
    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName == null ? null : loginName.trim();
    }
    /***
     使用hibernate validator出现上面的错误， 需要 注意
     @NotNull 和 @NotEmpty  和@NotBlank 区别
     @NotEmpty 用在集合类上面
     @NotBlank 用在String上面
     @NotNull    用在基本类型上
     如果在基本类型上面用NotEmpty或者NotBlank 会出现上面的错
     **/
    @NotEmpty(message = "密码不能为空")
    public String getLoginPassword() {
        return loginPassword;
    }

    public void setLoginPassword(String loginPassword) {
        this.loginPassword = loginPassword == null ? null : loginPassword.trim();
    }

    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }

    public Boolean getLoginSign() {
        return loginSign;
    }

    public void setLoginSign(Boolean loginSign) {
        this.loginSign = loginSign;
    }
}